package ch.pizzapp.kurier;

import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.UiThread;
import org.androidannotations.annotations.ViewById;

import android.app.Activity;
import android.content.Intent;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.Interpolator;
import ch.pizzapp.kurier.view.FlipImageView;

@EActivity(R.layout.splash_activity)
public class SplashActivity extends Activity implements FlipImageView.OnFlipListener {

    Interpolator[] fInterpolators = new Interpolator[]{
            new DecelerateInterpolator(),


    };

    @ViewById(R.id.imageView)
    FlipImageView flipImageView;

    @AfterViews
    void iniUi() {
        flipImageView.setOnFlipListener(this);

        flipImageView.toggleFlip();
    }

    @Override
    public void onClick(FlipImageView view) {

    }

    @Override
    public void onFlipStart(FlipImageView view) {

    }

    @Override
    public void onFlipEnd(FlipImageView view) {

        startMainActivity();

    }

    @UiThread(delay = 200)
    void startMainActivity() {
        Intent intent = new Intent(SplashActivity.this,
        		MainActivity_.class);

        startActivity(intent);
        overridePendingTransition(R.anim.open_next, R.anim.close_main);
        finish();
    }
}
